﻿using FluentNHibernate.Mapping;
using NHibernate.Type;
using Salary.Domain;

namespace Salary.NHibernate.Mappings
{
    public class TimesheetMap : ClassMap<Timesheet>
    {
        public TimesheetMap()
        {
            Table("Timesheets");
            Id(x => x.Id);
            References(x => x.Employee);
            Map(x => x.Date).CustomType<LocalDateTimeType>();
            Map(x => x.Hours).CustomSqlType("decimal");
            Map(x => x.OverWork).CustomType<bool>();
        }
    }
}
